package com.wy.two.Builder;

/**
 * @author 33117
 * @version 1.0
 * @data 2025/3/10 16:15
 * 这个示例演示了如何使用建造者模式创建不同类型的房屋，每种房屋
 * 类型的建造过程都由相应的具体建造者类负责实现，而指导者类负责协调建造过程。
 */
public class BuilderPatternExample {
    public static void main(String[] args) {
        HouseBuilder concreteBuilder = new ConcreteHouseBuilder();
        Director director1 = new Director(concreteBuilder);
        House concreteHouse = director1.constructHouse();
        System.out.println("Concrete House: " + concreteHouse);

        HouseBuilder luxuryBuilder = new LuxuryHouseBuilder();
        Director director2 = new Director(luxuryBuilder);
        House luxuryHouse = director2.constructHouse();
        System.out.println("Luxury House: " + luxuryHouse);
    }
}
